﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace PlanoAula.BD
{
    [Table("DiaAula")]
    public class DiaAula : TabelaBD
    {
        [Required]
        public Guid PlanoAulaCabId { get; set; }
        public virtual PlanoAulaCab PlanoAulaCab { get; set; }

        [Required]
        public int Dia { get; set; }
        [NotMapped]
        public virtual DayOfWeek DiaSemana
        {
            get
            {
                //return Dia.EnumTypeTo<DayOfWeek>();
                return (DayOfWeek)Dia;
            }
            set
            {
                this.Dia = (int)value;
            }
        }
        public int HoraInicio { get; set; }
        public int MinutoInicio { get; set; }
        public int HoraFinal { get; set; }
        public int MinutoFinal { get; set; }
        public int QtdAulas { get; set; }

        public virtual ICollection<PlanoAulaDetalhe> PlanoAulaDetalhes { get; set; }

        public override string ToString()
        {
            return "{0} - ({1}:{2} ~ {3}:{4})".FormatWith(this.DiaSemana.RetornarDiaPorExtenso(), HoraInicio, MinutoInicio, HoraFinal, MinutoFinal); 
        }
    }
}
